<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #p1,#p2 {
      height: 20px;
      border: 1px solid #111;
    }
    #p1 {
      margin-bottom: 20px;
    }
    #p2 {
      margin-top: 20px;
    }
  </style>
</head>

<body>
  <div>
    <div id="p1">p1</div>
    <div id="p2">p2</div>
  </div>

</body>

</html>